<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<jsp:include flush="true" page="../header.jsp"></jsp:include>
<script language="javascript"> 
function setfont(size,flag) 
{ 
var obj; 
if(flag=="thread")
obj=document.getElementById("thread"); 
else
obj=document.getElementsByTagName("reply"); 

obj.style.fontSize=size; 
} 
</script>

<div id="main">
	<div class="t3">
		<table cellspacing="0" cellpadding="0" width="100%" align="center">
			<tr>
				<td style="text-align: left;"><img
					src="images/yellow/index/home.gif" /> <b> <s:url
							action="list_category" id="url">
							<s:param name="category.id">${ board.category.id }</s:param>
						</s:url> <a href="${ url }">${ board.category.name }</a> &raquo; <s:url
							action="list_board" id="url">
							<s:param name="board.id">${ board.id }</s:param>
						</s:url> <a href="${ url }">${ board.name }</a> </b></td>
			</tr>
		</table>
	</div>

	<div class="t3">
		<table width="100%" align="center" cellspacing="0" cellpadding="0">
			<tr>
				<td align="left">
					<div class="fl">
						<div class="pages">${ pagination }</div>
					</div></td>
				<td align="right" style="padding-bottom: .2em"><s:url
						action="initAdd_reply" id="url">
						<s:param name="thread.id">${ thread.id }</s:param>
					</s:url> <a href="${ url }"><img src="images/yellow/reply.png" /> </a> <s:url
						action="initAdd_thread" id="url">
						<s:param name="board.id">${ board.id }</s:param>
					</s:url> <a href="${ url }" style="margin-left: .5em"><img
						src="images/yellow/post.png" id="td_post" /> </a></td>
			</tr>
		</table>
	</div>

	<!-- Thread Start -->
	<div class="t" style="margin-bottom: 0px; border-bottom: 0">
		<table cellspacing="0" cellpadding="0" width="100%">
			<tr>
				<th class="h"><strong class="fl w"><b>本页主题:</b> ${
						thread.title }</strong></th>
			</tr>
			<tr>
				<td></td>
			</tr>
			<tr class="tr2">
				<td colspan="2" class="tar"><br /></td>
			</tr>
			<tr>
				<td></td>
			</tr>
		</table>
	</div>

	<c:if test="${ pagination.pageNum == 1 }">
		<div class="t t2">
			<table cellspacing="0" cellpadding="0" width="100%"
				style="table-layout: fixed; border-top: 0">
				<tr class="tr1">
					<th style="width: 20%" rowspan="2" class="r_two"><b>作者：${
							thread.author.name }</b></th>
					<th height="100%" class="r_one" valign="top" id="td_4900235"
						style="padding: 5px 15px 0 15px; border: 0; width: 80%; overflow: hidden">
						<div class="tiptop">
							<span class="fr s3" style="margin: 0 0 0 1em"> 楼主 </span> <span
								class="fl" style="white-space: nowrap;"> 引用 推荐 <s:set
									name="author" value="thread.author.account"></s:set> <s:if
									test="#session.personInfo.account ==#author||#session.personInfo.account=='admin'">
									<s:url action="view_thread" id="url">
										<s:param name="thread.id">${thread.id}</s:param>
										<s:param name="flag">edit</s:param>
									</s:url>
									<s:a href="%{url}">编辑</s:a>
									<s:url action="delete_thread" id="url">
										<s:param name="thread.id">${thread.id}</s:param>
									</s:url>
									<s:a href="%{url}">删除</s:a>
								</s:if> <s:else>编辑</s:else> <s:if test="flag=='hit'">
									<s:url action="view_thread" id="url">
										<s:param name="thread.id">${thread.id}</s:param>
										<s:param name="person.id">${ thread.author.id}</s:param>

									</s:url>
									<s:a href="%{url}">
								 只看楼主 </s:a>
								</s:if>
								<s:else>
									<s:url action="view_thread" id="url">
										<s:param name="thread.id">${thread.id}</s:param>
										<s:param name="flag">hit</s:param>
									</s:url>
									<s:a href="%{url}">
								 阅读全部</s:a>
								</s:else> </span>
							<div class="c"></div>
						</div>
						<h1 id="subject_4900235" class="fl">&nbsp;</h1>

						<div id="p_4900235" class="c"></div>

						<div class="tpc_content" id="thread">${ thread.content }</div></th>
				</tr>
				<tr class="tr1 r_one">
					<th style="vertical-align: bottom; padding-left: 15px; border: 0">

						<div id="w_4900235" class="c"></div>

						<div class="tipad">
							<span style="float: right"> <a
								href="javascript:scroll(0,0)" title="顶端">顶端</a> </span> <span
								class="gray">Posted: <fmt:formatDate
									value="${thread.dateCreated }" pattern="yyyy-MM-dd HH:mm:ss" />
							</span>

						</div></th>
				</tr>
			</table>
		</div>
	</c:if>

	<!-- Thread End -->

	<!-- Reply Start -->

	<c:forEach var="reply" items="${ replyList }">
		<div class="t t2">
			<table cellspacing="0" cellpadding="0" width="100%"
				style="table-layout: fixed; border-top: 0">
				<tr class="tr1">
					<th style="width: 20%" rowspan="2" class="r_two"><b>作者：${
							reply.author.name }</b></th>
					<th height="100%" class="r_one" valign="top" id="td_4900235"
						style="padding: 5px 15px 0 15px; border: 0; width: 80%; overflow: hidden">
						<div class="tiptop">
							<span class="fr s3" style="margin: 0 0 0 1em"> ${
								reply.floor } 楼 </span> <span class="fl" style="white-space: nowrap;">
								引用 推荐<s:set name="author" value="thread.author.account"></s:set>
								<s:if
									test="#session.personInfo.account ==#author||#session.personInfo.account=='admin'">
									<s:url action="delete_reply" id="url">
										<s:param name="reply.id">${reply.id}</s:param>
									</s:url>
									<s:a href="%{url}">删除</s:a>
								</s:if> <s:else>编辑</s:else> <s:url action="view_thread" id="url">
									<s:param name="thread.id">${thread.id}</s:param>
									<s:param name="person.id">${ reply.author.id}</s:param>
								</s:url> <s:a href="%{url}">
								 只看作者 </s:a>
							</span>
							<div class="c"></div>
						</div>
						<h1 id="subject_4900235" class="fl">&nbsp;</h1>

						<div id="p_4900235" class="c"></div>

						<div class="tpc_content" id="reply">${ reply.content }</div></th>
				</tr>
				<tr class="tr1 r_one">
					<th style="vertical-align: bottom; padding-left: 15px; border: 0">

						<div id="w_4900235" class="c"></div>

						<div class="tipad">
							<span style="float: right"> <a
								href="javascript:scroll(0,0)" title="顶端">顶端</a> </span> <span
								class="gray">Posted: <fmt:formatDate
									value="${reply.dateCreated }" pattern="yyyy-MM-dd HH:mm:ss" />
							</span>
						</div></th>
				</tr>
			</table>
		</div>
	</c:forEach>


	<div class="t3">
		<table width="100%" align="center" cellspacing="0" cellpadding="0">
			<tr>
				<td align="left">
					<div class="fl">
						<div class="pages">${ pagination }</div>
					</div></td>
				<td align="right" style="padding-bottom: .2em"><s:url
						action="initAdd_reply" id="url">
						<s:param name="thread.id">${ thread.id }</s:param>
					</s:url> <a href="${ url }"><img src="images/yellow/reply.png" /> </a> <s:url
						action="initAdd_thread" id="url">
						<s:param name="board.id">${ board.id }</s:param>
					</s:url> <a href="${ url }" style="margin-left: .5em"><img
						src="images/yellow/post.png" id="td_post" /> </a></td>
			</tr>
		</table>
	</div>
</div>
<!-- Reply End -->

<jsp:include flush="true" page="../footer.jsp" />
